//using Linq;
using System.Drawing;
//using Linq;
using Infragistics.Win;

//'
public class clsControlColores
{

   //'
   //Public Shared Sub CambiarColorBarra(ByRef utmAFormatear As UltraWinToolbars.UltraToolbarsManager)
   public static void CambiarColorBarra(Infragistics.Win.UltraWinToolbars.UltraToolbarsManager utmAFormatear)
   {
      //utmAFormatear.Appearance.BackColor =UltraGridColorBarra
      utmAFormatear.Appearance.BackColor = clsVariables.Colores.UltraToolbarsManagerBackColor; //Color.LightSteelBlue
      utmAFormatear.Appearance.BackColor2 = clsVariables.Colores.UltraToolbarsManagerBackColor2; //Color.LightSteelBlue
      //utmAFormatear.Appearance.BackColor2 = Color.Lavender
      utmAFormatear.Appearance.BackGradientStyle = clsVariables.Colores.UltraToolbarsManagerGradientStyle;
   }
   //'
   public static void CagarColoresGrid(Infragistics.Win.UltraWinGrid.UltraGrid Gr)
   {
      //Fondo grid
      Gr.DisplayLayout.Appearance.BackColor = clsVariables.Colores.UltraGridBackColor;
      Gr.DisplayLayout.Appearance.BackColor2 = clsVariables.Colores.UltraGridBackColor2;
      Gr.DisplayLayout.Appearance.BackGradientStyle = clsVariables.Colores.UltraGridBackGradientStyle;
      //
      //GroupByBox
      Gr.DisplayLayout.GroupByBox.BorderStyle = clsVariables.Colores.UltraGridGroupByBoxBorderStyle;
      Gr.DisplayLayout.GroupByBox.Appearance.BackColor = clsVariables.Colores.UltraGridGroupByBoxBackColor;
      Gr.DisplayLayout.GroupByBox.Appearance.BackColor2 = clsVariables.Colores.UltraGridGroupByBoxBackColor2;
      Gr.DisplayLayout.GroupByBox.Appearance.BackGradientStyle = clsVariables.Colores.UltraGridGroupByBoxBackGradientStyle;
      Gr.DisplayLayout.GroupByBox.PromptAppearance.BackColor = clsVariables.Colores.UltraGridGroupByBoxPromptBackColor;
      Gr.DisplayLayout.GroupByBox.PromptAppearance.BackColor2 = clsVariables.Colores.UltraGridGroupByBoxPromptBackColor2;
      Gr.DisplayLayout.GroupByBox.PromptAppearance.BackGradientStyle = clsVariables.Colores.UltraGridPromptAppearanceBackGradientStyle;
      Gr.DisplayLayout.GroupByBox.PromptAppearance.ForeColor = clsVariables.Colores.UltraGridGroupByBoxPromptForeColor;
      //
      //GroupByBox Row
      Gr.DisplayLayout.Override.GroupByRowAppearance.BackColor = clsVariables.Colores.UltraGridGroupByRowAppearanceBackColor;
      Gr.DisplayLayout.Override.GroupByRowAppearance.BackColor2 = clsVariables.Colores.UltraGridGroupByRowAppearanceBackColor2;
      Gr.DisplayLayout.Override.GroupByRowAppearance.BackGradientStyle = clsVariables.Colores.UltraGridGroupByRowAppearanceBackGradientStyle;
      //
      //GroupByBox Row Activa
      Gr.DisplayLayout.Override.SelectedRowAppearance.BackColor = clsVariables.Colores.UltraGridSelectedRowAppearanceBackColor;
      Gr.DisplayLayout.Override.SelectedRowAppearance.BackColor2 = clsVariables.Colores.UltraGridSelectedRowAppearanceBackColor2;
      Gr.DisplayLayout.Override.SelectedRowAppearance.BackGradientStyle = clsVariables.Colores.UltraGridSelectedRowAppearanceBackGradientStyle;
      //
      Gr.DisplayLayout.Override.FixedCellAppearance.BackColor = Color.Khaki;
      Gr.DisplayLayout.Override.FixedCellAppearance.BackColor2 = Color.Khaki;
      //.BackGradientStyle = UltraGridSelectedRowAppearanceBackGradientStyle
      //
      //Cabecera grid
      //grid.DisplayLayout.Override.HeaderAppearance.BackColor = Color.IndianRed
      //grid.DisplayLayout.Override.HeaderAppearance.BackColor2 = Color.IndianRed
      Gr.DisplayLayout.Override.HeaderAppearance.ThemedElementAlpha = Alpha.Transparent; //sino no lo aplica!
      Gr.DisplayLayout.Override.HeaderAppearance.BackColor = clsVariables.Colores.UltraGridHeaderBackColor;
      Gr.DisplayLayout.Override.HeaderAppearance.BackColor2 = clsVariables.Colores.UltraGridHeaderBackColor2;
      Gr.DisplayLayout.Override.HeaderAppearance.BackGradientStyle  = clsVariables.Colores.UltraGridHeaderBackGradientStyle;
      //
      Gr.DisplayLayout.Override.GroupByColumnHeaderAppearance.BackColor = clsVariables.Colores.UltraGridGroupByColumnHeaderBackColor;
      Gr.DisplayLayout.Override.GroupByColumnHeaderAppearance.BackColor2 = clsVariables.Colores.UltraGridGroupByColumnHeaderBackColor2;
      Gr.DisplayLayout.Override.GroupByColumnHeaderAppearance.BackGradientStyle = clsVariables.Colores.UltraGridGroupByColumnHeaderBackGradientStyle;
      //
      //Row y celda activa
      //Sino uso Alpha Level hace cosas raras 8cogfe el difuminado de otras partes)
      Gr.DisplayLayout.Override.ActiveRowAppearance.BackGradientStyle = GradientStyle.None; //.Opaque
      Gr.DisplayLayout.Override.ActiveRowAppearance.BackColor = clsVariables.Colores.UltraGridActiveRowBackColor;
      Gr.DisplayLayout.Override.ActiveRowAppearance.ForeColor = clsVariables.Colores.UltraGridActiveRowForeColor;
      Gr.DisplayLayout.Override.ActiveCellAppearance.BackGradientStyle = GradientStyle.None; //Opaque
      Gr.DisplayLayout.Override.ActiveCellAppearance.BackColor = clsVariables.Colores.UltraGridActiveCellBackColor;
      Gr.DisplayLayout.Override.ActiveCellAppearance.ForeColor = clsVariables.Colores.UltraGridActiveCellForeColor;
      //
      //
      //
   }
   //'
   public static void CambiarColoresTab(Infragistics.Win.UltraWinTabControl.UltraTabControl CtrlTab)
   {
      //Apperance
      CtrlTab.TabHeaderAreaAppearance.BackColor = clsVariables.Colores.UltraTabHeaderAreaBackColor;
      CtrlTab.TabHeaderAreaAppearance.BackColor2 = clsVariables.Colores.UltraTabHeaderAreaBackColor2;
      CtrlTab.TabHeaderAreaAppearance.BorderColor = clsVariables.Colores.UltraTabHeaderAreaBorderColor;
      CtrlTab.TabHeaderAreaAppearance.BorderColor2 = clsVariables.Colores.UltraTabHeaderAreaBorderColor2;
      CtrlTab.TabHeaderAreaAppearance.BackGradientStyle = clsVariables.Colores.UltraTabHeaderAreaBackGradientStyle;
      CtrlTab.TabHeaderAreaAppearance.ForeColor = clsVariables.Colores.UltraTabHeaderAreaForeColor;
      CtrlTab.TabHeaderAreaAppearance.ThemedElementAlpha = Alpha.Transparent;

      //Tabs No activas
      CtrlTab.Appearance.BackColor = clsVariables.Colores.UltraTabBackColor;
      CtrlTab.Appearance.BackColor2 = clsVariables.Colores.UltraTabBackColor2;
      CtrlTab.Appearance.BorderColor = clsVariables.Colores.UltraTabBorderColor;
      CtrlTab.Appearance.BorderColor2 = clsVariables.Colores.UltraTabBorderColor2;
      CtrlTab.Appearance.BackGradientStyle = clsVariables.Colores.UltraTabBackGradientStyle;
      CtrlTab.Appearance.ForeColor = clsVariables.Colores.UltraTabForeColor;
      CtrlTab.Appearance.ThemedElementAlpha = Alpha.Transparent;

      //Tabs Activas
      CtrlTab.ActiveTabAppearance.BackColor = clsVariables.Colores.UltraTabActivaBackColor;
      CtrlTab.ActiveTabAppearance.BackColor2 = clsVariables.Colores.UltraTabActivaBackColor2;
      CtrlTab.ActiveTabAppearance.BorderColor = clsVariables.Colores.UltraTabActivaBorderColor;
      CtrlTab.ActiveTabAppearance.BorderColor2 = clsVariables.Colores.UltraTabActivaBorderColor2;
      CtrlTab.ActiveTabAppearance.BackGradientStyle = clsVariables.Colores.UltraTabActivaBackGradientStyle;
      CtrlTab.ActiveTabAppearance.ForeColor = clsVariables.Colores.UltraTabActivaForeColor;
      CtrlTab.ActiveTabAppearance.ThemedElementAlpha = Alpha.Transparent;
   }
   //'
   public static void CambiarColoresTabMDIManager(Infragistics.Win.UltraWinTabbedMdi.UltraTabbedMdiManager TabMDI)
   {
      //Apperance
      TabMDI.Appearance.BackColor = clsVariables.Colores.UltraTabMDIManagerBackColor;
      TabMDI.Appearance.BackColor2 = clsVariables.Colores.UltraTabMDIManagerBackColor2;
      TabMDI.Appearance.BorderColor = clsVariables.Colores.UltraTabMDIManagerBorderColor;
      TabMDI.Appearance.BorderColor2 = clsVariables.Colores.UltraTabMDIManagerBorderColor2;
      TabMDI.Appearance.BackGradientStyle = clsVariables.Colores.UltraTabMDIManagerBackGradientStyle;
      TabMDI.Appearance.ForeColor = clsVariables.Colores.UltraTabMDIManagerForeColor;
      //
      //Tabs No activas
      TabMDI.TabSettings.TabAppearance.BackColor = clsVariables.Colores.UltraTabMDIManagerTabBackColor;
      TabMDI.TabSettings.TabAppearance.BackColor2 = clsVariables.Colores.UltraTabMDIManagerTabBackColor2;
      TabMDI.TabSettings.TabAppearance.BorderColor = clsVariables.Colores.UltraTabMDIManagerTabBorderColor;
      TabMDI.TabSettings.TabAppearance.BorderColor2 = clsVariables.Colores.UltraTabMDIManagerTabBorderColor2;
      TabMDI.TabSettings.TabAppearance.BackGradientStyle = clsVariables.Colores.UltraTabMDIManagerTabBackGradientStyle;
      TabMDI.TabSettings.TabAppearance.ForeColor = clsVariables.Colores.UltraTabMDIManagerTabForeColor;
      //
      //Tabs Activas
      TabMDI.TabSettings.ActiveTabAppearance.BackColor = clsVariables.Colores.UltraTabMDIManagerTabActivaBackColor;
      TabMDI.TabSettings.ActiveTabAppearance.BackColor2 = clsVariables.Colores.UltraTabMDIManagerTabActivaBackColor2;
      TabMDI.TabSettings.ActiveTabAppearance.BorderColor = clsVariables.Colores.UltraTabMDIManagerTabActivaBorderColor;
      TabMDI.TabSettings.ActiveTabAppearance.BorderColor2 = clsVariables.Colores.UltraTabMDIManagerTabActivaBorderColor2;
      TabMDI.TabSettings.ActiveTabAppearance.BackGradientStyle = clsVariables.Colores.UltraTabMDIManagerTabActivaBackGradientStyle;
      TabMDI.TabSettings.ActiveTabAppearance.ForeColor = clsVariables.Colores.UltraTabMDIManagerTabActivaForeColor;
   }

   public static Color DeStringAColor(string strColor)
   {
      Color Ret;
      Ret = System.Drawing.Color.FromName(strColor);
      return Ret;
   }
   //'
}


